{extend name="$base" /}
{block name="resources"}
<script type="text/javascript" src="__STATIC__/My97DatePicker/WdatePicker.js"></script>
<style>
.ns-main{margin-top:0;}
.alert .mt5 .h30{font-size:12px;margin-top:10px;}
.basic_data_ons{
	width: 100%;
	height: 255px;
    box-sizing: border-box;
	border: 1px solid  #e6e9f0;
}
.basic_data_ons	.basic_data_ons_son{
	width: 100%;
	height: 30px;
	line-height: 30px;
	font-size: 13px;
	border-bottom: 1px solid  #e6e9f0;
	text-indent: 10px;
	background: #f5f7fa;
}
.basic_data_ons .basic_data_ons_son_list{
	width: 100%;
	height: 84%;
}
.basic_data_ons .basic_data_ons_son_list li{
	width: 20%;
	height: 50%;
	float: left;
}
.basic_data_ons .basic_data_ons_son_list li .basic_data_ons_son_list_nvs{
    width:80%;
	height:80%;
	margin:0 auto;
	text-align:center;
}
.basic_data_ons .basic_data_ons_son_list li .basic_data_ons_son_list_nvs p{
    line-height:30px;
	font-size:12px;
	color:#5e6166;
	margin-top:40px;
	margin-bottom: 0;
}
.basic_data_ons .basic_data_ons_son_list li .basic_data_ons_son_list_nvs cite{
    line-height: 39px;
    font-size: 20px;
    color: #00A0DE;
}
</style>
{/block}
{block name="main"}
<div class="basic_data_ons">
	<ul class="basic_data_ons_son_list">
        <li>
            <div class="basic_data_ons_son_list_nvs">
                <p>商城订单支出</p>
				<cite>￥{$money_sum.shancghen_sum}</cite>
			</div>
		</li>
		<li>
			<div class="basic_data_ons_son_list_nvs">
                <p>商城订单退还</p>
				<cite>￥{$money_sum.order_sum}</cite>
			</div>
		</li>
		<li>
			<div class="basic_data_ons_son_list_nvs">
                <p>兑换</p>
				<cite>￥{$money_sum.duihuan_sum}</cite>
			</div>
		</li>
		<li>
			<div class="basic_data_ons_son_list_nvs">
                <p>充值</p>
				<cite>￥{$money_sum.chongzhi_sum}</cite>
			</div>
		</li>
		<li>
			<div class="basic_data_ons_son_list_nvs">
                <p>调整</p>
				<cite>￥{$money_sum.tiaozheng_sum}</cite>
			</div>
		</li>
		<li>
			<div class="basic_data_ons_son_list_nvs">
                <p>提现</p>
				<cite>￥{$money_sum.tixian_sum}</cite>
			</div>
		</li>
		<li>
			<div class="basic_data_ons_son_list_nvs">
                <p>提现退还</p>
				<cite>￥{$money_sum.titui_sum}</cite>
			</div>
		</li>
	</ul>
</div>
<table class="mytable">
	<tr>
		<td width="10%" class="default-condition">
			<input type="text" id='search_text' placeholder="请输入会员昵称" class="input-common  middle" />
			<!-- 更多搜索按钮 -->
			<button type="button" onclick="searchData()" value="搜索" class="btn-common">搜索</button>
			<button onclick="openSeniorSearch('.default-condition')" value="搜索" class="btn-common" >高级搜索</button>
			<button type="button" onclick="yuedaochu()" value="搜索" class="btn-common">导出数据</button>
		</td>
	</tr>
</table>

<!-- 高级搜索 -->
<div class="nui-condition">
	<div class="c-item-column">
		<label for="search_text">会员昵称：</label>
		<input type="text" id='search_text' placeholder="请输入会员昵称" class="input-common middle" />
	</div>
	<div class="c-item-column">
		<label for="form_type">发生类别：</label>
		<select id="form_type" class="select-common middle">
			<option value="">全部</option>
			{volist name="from_type_list" id="val"}
			<option value="{$val.type_id}">{$val.type_name}</option>
			{/volist}
		</select>	
	</div>
	<div class="c-item-column">
		<label for="startDate">发生时间：</label>
		<input type="text" id='startDate' placeholder="请选择开始日期" class="input-medium input-common middle" onclick="WdatePicker()"/>
			&nbsp;-&nbsp;
		<input type="text" id='endDate' placeholder="请选择结束日期" class="input-medium input-common middle" onclick="WdatePicker()" />
	</div>
	
	<div class="c-operation">
		<button onclick="searchData()"  value="搜索" class="btn-common" >搜索</button>
		<button onclick="yuedaochu()"  value="导出" class="btn-common-white" >导出</button>
		<a href="javascript:clearCondition();">清空筛选条件</a>
	</div>
	<a href="javascript:retractSeniorSearch();" class="retract">收起↑</a>
</div>

<table class="table-class">
	<colgroup>
		<col style="width: 2%;">
		<col style="width: 15%;">
		<col style="width: 20%;">
		<col style="width: 32%;">
		<col style="width: 15%;">
		<col style="width: 16%;">
	</colgroup>
	<thead>
		<tr align="left">
			<th align="center"><i class="checkbox-common"><input type="checkbox" ></i></th>
			<th>会员昵称</th>
			<th>类别</th>
			<th>描述</th>
			<th align="right">金额<span class="row-30"></th>
			<th align="center">时间</th>
		</tr>
	</thead>
	<tbody></tbody>
</table>
{/block}
{block name="script"}
<script type="text/javascript">
function LoadingInfo(page_index) {
	var search_text = $("#search_text").val();
	var start_date = $("#startDate").val();
	var form_type = $("#form_type").val();
	var end_date = $("#endDate").val();
	$.ajax({
		type : "post",
		url : "{:__url('ADMIN_MAIN/member/accountlist')}",
		data : { "page_index" : page_index, "page_size" : $("#showNumber").val(), "search_text":search_text, "form_type":form_type, "start_date":start_date, "end_date":end_date },
		success : function(data) {
			if (data["data"].length > 0) {
				$(".table-class tbody").empty();
				for (var i = 0; i < data["data"].length; i++) {
					var html = '';
					html += '<tr align="left">';
					html += '<td  style="text-align: center;"><i class="checkbox-common"><input name="sub" type="checkbox" value="'+ data["data"][i]["id"]+'" ></i></td>';
					if(data["data"][i]["nick_name"]==null){
						html += '<td>--</td>';
					}else{
						html += '<td>'+ data["data"][i]["nick_name"] +'</td>';
					}
					html += '<td>'+data["data"][i]["type_name"]+'</td>';
					html += '<td>'+ data["data"][i]["text"];
					if(data["data"][i]["data_content"] != undefined && data["data"][i]["data_content"]["order_no"].length > 0){
						html += '【订单号：<a href="'+__URL('ADMIN_MAIN/order/orderdetail?order_id='+data["data"][i]["data_content"]["order_id"])+'">'+data["data"][i]["data_content"]["order_no"]+'</a>】';
					}
					html += '</td>';
					html += '<td align="right">'+ data["data"][i]["number"] +'<span class="row-30"></td>';
					html += '<td align="center">'+ timeStampTurnTime(data["data"][i]["create_time"]) +'</td>';
					html += '</tr>';
					$(".table-class tbody").append(html);
				}
			} else {
				var html = '<tr align="center"><td colspan="9">暂无符合条件的数据记录</td></tr>';
				$(".table-class tbody").html(html);
			}
			initPageData(data["page_count"],data['data'].length,data['total_count']);
			$("#pageNumber").html(pagenumShow(jumpNumber,$("#page_count").val(),{$pageshow}));
		}
	});
}

function searchData(){
	LoadingInfo(1);
}

//点击显示更多搜索
$(".more-search").click(function(){
	$(".more-search-container").slideToggle();
});

function yuedaochu(){
	var search_text = $("#search_text").val();
	var start_date = $("#startDate").val();
	var form_type = $("#form_type").val();
	var end_date = $("#endDate").val();
	location.href = __URL('ADMIN_MAIN/member/yuedaochu?search_text='+ search_text +'&start_date='+ start_date +'&form_type='+ form_type +'&end_date='+end_date);
}
</script>
{/block}